package com.ctshk.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 套票单项枚举
 *
 * @author Eric 2021-05-7
 */
public enum SeasonType {

    IDENTIFY_HK(1352196914306744321L, "00", "身份證(香港)"),
    PASSPORT(1369475300831977474L, "03", "護照"),
    RETURN_HOME(1352196993784610818L, "06", "返鄉證"),

    PRODUCT_FIXED_TYPE(1, "1", "固定套票", ""),
    PRODUCT_DYNAMIC_TYPE(2, "2", "动态套票", ""),

    IS_ONSHELF(1, "1", "上架", "上架状态"),
    NO_ONSHELF(0, "0", "下架", "上架状态"),

    VALID(1, "1", "有效", "状态"),
    INVALID(0, "0", "无效", "状态"),

    IS_RECOMMEND(1, "1", "推荐", "是否推荐"),
    NO_RECOMMEND(0, "0", "不推荐", "是否推荐"),

    OFFLINE_SELF_CHANNEL_TYPE(1, "1", "自营渠道", "线下渠道类型"),
    OFFLINE_AGENT_CHANNEL_TYPE(2, "2", "代理商", "线下渠道类型"),
    ONLINE_SELF_CHANNEL_TYPE(3, "3", "线上官方", "线上渠道类型"),
    //  ONLINE_THIRD_CHANNEL_TYPE(4, "4", "线上第三方", "线上渠道类型"),

    AGENT_VISABLE_NO(1, "1", "自营禁售", "线下权限范围"),
    ALL_DEPARTMENT(2, "2", "所有部门", "线下权限范围"),
    ASSIGN_VISABLE(2, "2", "指定部门", "线下权限范围"),

    CHECK_DEPARTMENT(1, "1", "勾选部门", "勾选状态"),
    CHECK_EMPLOYEE(2, "2", "勾选员工", "勾选状态"),

    YES_DEFAULT(1, "1", "默认", "是否默认"),
    NO_DEFAULT(0, "0", "不是默认", "勾选状态"),

    ADULT(1, "1", "成人", "旅客类型"),
    CHILD(2, "2", "儿童", "旅客类型"),

    ADJUST_TYPE_NUMBER(1, "1", "数值", "加幅类型"),
    ADJUST_TYPE_PERCENT(2, "2", "百分比", "加幅类型"),

    JOURNEY_TYPE_DEPART(1, "depart", "出发", "旅游行程类型"),
    JOURNEY_TYPE_RETURN(2, "return", "返回", "旅游行程类型"),

    AIR_HOTEL(1, "1", "机票+酒店", "套票类型"),
    SCENIC_HOTEL(2, "2", "酒店+门票", "套票类型"),
    SHIP_HOTEL(3, "3", "船票+酒店", "套票类型"),
    BUS_HOTEL(4, "4", "巴士+酒店", "套票类型"),
    TRAIN_HOTEL(5, "5", "火车+酒店", "套票类型"),

    WAIT_SUBMIT(1, "1", "待提交", "套票审批类型"),
    APPROVAL(2, "2", "审批中", "套票审批类型"),
    REVIEW_PASS(3, "3", "审批通过", "套票审批类型"),
    APPROVAL_FAIL(4, "4", "审批不通过", "套票审批类型");


    private Integer code;
    private Long codeLong;
    private String key;
    private String name;
    private String remark;

    SeasonType(Integer code, String key, String name, String remark) {
        this.code = code;
        this.key = key;
        this.name = name;
        this.remark = remark;
    }

    SeasonType(Long codeLong, String key, String name) {
        this.codeLong = codeLong;
        this.key = key;
        this.name = name;
    }

    public static SeasonType getEnumType(Integer code, String key) {
        for (SeasonType each : SeasonType.values()) {
            if (StringUtils.isBlank(key)) {
                if (each.getCode() == code) {
                    return each;
                }
            } else {
                if (each.getKey().equals(key)) {
                    return each;
                }
            }

        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Long getCodeLong() {
        return codeLong;
    }

    public void setCodeLong(Long codeLong) {
        this.codeLong = codeLong;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

}
